--- configure.ac.orig	Wed Jan 22 12:23:36 2014
+++ configure.ac	Sun Apr 19 15:03:55 2015
@@ -207,7 +207,7 @@ if test "x$JACK_USE_MACH_THREADS" != "x"; then
 fi
 
 # headers
-AC_CHECK_HEADERS(string.h strings.h alloca.h db.h, [],
+AC_CHECK_HEADERS(string.h strings.h db.h, [],
      AC_MSG_ERROR([*** a required header file is missing]))
 
 AC_CHECK_HEADERS(getopt.h, [], [
@@ -761,7 +761,7 @@ AC_SUBST(NETJACK_CFLAGS)
 
 # Check which backend drivers can be built.  The last one successfully
 # configured becomes the default JACK driver; so the order of
-# precedence is: alsa, sun, oss, coreaudio, portaudio, dummy.
+# precedence is: alsa, sun, sndio, oss, coreaudio, portaudio, dummy.
 
 JACK_DEFAULT_DRIVER=\"dummy\"
 
@@ -821,6 +821,20 @@ then
 fi
 AM_CONDITIONAL(HAVE_SUN, $HAVE_SUN)
 
+AC_ARG_ENABLE(sndio, AC_HELP_STRING([--disable-sndio],[ignore sndio driver ]),
+			TRY_SNDIO=$enableval , TRY_SNDIO=yes ) 
+HAVE_SNDIO="false"
+if test "x$TRY_SNDIO" = "xyes"
+then
+	# check for sndio audio API
+	AC_CHECK_HEADER([sndio.h],
+	     [HAVE_SNDIO="true"
+              JACK_DEFAULT_DRIVER=\"sndio\"])
+	SNDIO_LIBS="-lsndio"
+	AC_SUBST([SNDIO_LIBS])
+fi
+AM_CONDITIONAL(HAVE_SNDIO, $HAVE_SNDIO)
+
 AC_ARG_ENABLE(freebob, AC_HELP_STRING([--disable-freebob],[ignore FreeBob driver ]),
 			TRY_FREEBOB=$enableval , TRY_FREEBOB=yes ) 
 HAVE_FREEBOB="false"
@@ -953,6 +967,7 @@ drivers/alsa_midi/Makefile
 drivers/dummy/Makefile
 drivers/oss/Makefile
 drivers/sun/Makefile
+drivers/sndio/Makefile
 drivers/portaudio/Makefile
 drivers/coreaudio/Makefile
 drivers/freebob/Makefile
@@ -984,6 +999,7 @@ echo \| Build with old FireWire \(FreeBob\) support...
 echo \| Build with new FireWire \(FFADO\) support............... : $HAVE_FIREWIRE
 echo \| Build with OSS support................................ : $HAVE_OSS
 echo \| Build with Sun audio support.......................... : $HAVE_SUN
+echo \| Build with sndio support.............................. : $HAVE_SNDIO
 echo \| Build with CoreAudio support.......................... : $HAVE_COREAUDIO
 echo \| Build with PortAudio support.......................... : $HAVE_PA
 echo \| Build with Celt support............................... : $HAVE_CELT
